package com.UI
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	import com.UI.*;
	
	import flash.display.*;
	import flash.display.BitmapData;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	import flash.utils.ByteArray;
	import flash.utils.getQualifiedClassName;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.graphics.*;
	import org.aswing.tree.AbstractLayoutCache;
	
	public class PanelSkillName extends JPanel
	{
		public var panelName:JPanel;
		public function PanelSkillName()
		{
			//component creation
			setSize(new IntDimension(43, 43));
			//setPreferredSize(new IntDimension(43, 43));
			var layout0:EmptyLayout = new EmptyLayout();
			setLayout(layout0);
			
			panelName = new JPanel();
			panelName.setLocation(new IntPoint(2, 2));
			panelName.setSize(new IntDimension(40, 40));
			
			//component layoution
			append(panelName);
			
			img_skill_name_bg_2 = new AssetBackground(Client.getUIElement("img_skill_name_bg_2") as DisplayObject);
			img_skill_name_bg_4 = new AssetBackground(Client.getUIElement("img_skill_name_bg_4") as DisplayObject);
		}
		private var img_skill_name_bg_2:AssetBackground = null;
		private var img_skill_name_bg_4:AssetBackground = null;
		public function setSkillName(csv_id:int):Boolean
		{
			var dis:DisplayObject = Client.getUIElement("img_skill_name_"+csv_id) as DisplayObject;
			if(dis == null)
				return false;
			panelName.setBackgroundDecorator(new AssetBackground(dis));
			if(csv_id<=4 || (csv_id >= 41 && csv_id <= 45))
			{
				setBackgroundDecorator(img_skill_name_bg_2);
				setPreferredSize(new IntDimension(74, 87));
				panelName.setPreferredSize(new IntDimension(44, 24));
				panelName.setLocation(new IntPoint(18, 46));
			}
			else
			{
				setBackgroundDecorator(img_skill_name_bg_4);
				setPreferredSize(new IntDimension(134, 101));
				panelName.setPreferredSize(new IntDimension(89, 24));
				panelName.setLocation(new IntPoint(29, 46));
			}
			panelName.pack();
			panelName.paintImmediately();
			pack();
			paintImmediately();
			return true;
		}
	}
}